#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    ui->textEditorsManager->newFile();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::closeEvent(QCloseEvent * event)
{
    while(ui->textEditorsManager->count() > 0) {
        if(!ui->textEditorsManager->closeFile(0)) {
            event->ignore();
            break;
        }
    }
}
